Progress Bar progressStart() - can I show it without underlying DB?

Hoping to get some help with this issue:

The progressStart() function requires a DB argument:
but my script has no GUI of its own, it just runs (invoked from module menu)
and puts up a terminal dialog box when all done.

I want an interim progress bar without any other window,
so what would I use as the DB argument in the progressBar() call?

Regards,
Strathglass.
strathglass - Mon Jul 06 11:09:44 EDT 2009

Re: Progress Bar progressStart() - can I show it without underlying DB?
IBM_Gust - Mon Jul 06 15:35:58 EDT 2009

This may be what you want:
 

void progCB(DB x ) { 
    Object o 
    int nos = 0 
    for o in current Module do nos++ 
    progressStart(x, "Experiment", "Something", nos) 
    nos = 0 
    for o in current Module do {
        string h = o."Object Heading"
        progressStep ++nos
        if (null h) h = "null heading"
        progressMessage h 
        if (progressCancelled) {
            if (confirm("Exit loop?")) {
                progressStop
                halt
            }
        }
    } 
    progressStop 
}
DB progressDB = create "Progress test" 
realize progressDB 
progCB(progressDB)
hide progressDB

Re: Progress Bar progressStart() - can I show it without underlying DB?
strathglass - Mon Jul 06 16:02:43 EDT 2009

IBM_Gust - Mon Jul 06 15:35:58 EDT 2009

This may be what you want:
 

void progCB(DB x ) { 
    Object o 
    int nos = 0 
    for o in current Module do nos++ 
    progressStart(x, "Experiment", "Something", nos) 
    nos = 0 
    for o in current Module do {
        string h = o."Object Heading"
        progressStep ++nos
        if (null h) h = "null heading"
        progressMessage h 
        if (progressCancelled) {
            if (confirm("Exit loop?")) {
                progressStop
                halt
            }
        }
    } 
    progressStop 
}
DB progressDB = create "Progress test" 
realize progressDB 
progCB(progressDB)
hide progressDB

Thanks.
That looks like the example program in DOORS:
The problem is it puts up a "Progress test" DB (on which the Progress Bar dialog can be put): if you cancel out of the progress bar instead of letting it complete, you have to manually close the "Progress test" DB.

I want to put up the progress bar without any other underlying DB like "Progress test".

I was thinking maybe there is a way to have DB take on the value associated with the module I am running the script from. Maybe?

Regards, Strathglass.

Re: Progress Bar progressStart() - can I show it without underlying DB?
IBM_Gust - Mon Jul 06 16:41:01 EDT 2009

strathglass - Mon Jul 06 16:02:43 EDT 2009
Thanks.
That looks like the example program in DOORS:
The problem is it puts up a "Progress test" DB (on which the Progress Bar dialog can be put): if you cancel out of the progress bar instead of letting it complete, you have to manually close the "Progress test" DB.

I want to put up the progress bar without any other underlying DB like "Progress test".

I was thinking maybe there is a way to have DB take on the value associated with the module I am running the script from. Maybe?

Regards, Strathglass.

It never hurts to dream big.

Re: Progress Bar progressStart() - can I show it without underlying DB?
djakad - Tue Jul 07 17:02:46 EDT 2009

IBM_Gust - Mon Jul 06 15:35:58 EDT 2009

This may be what you want:
 

void progCB(DB x ) { 
    Object o 
    int nos = 0 
    for o in current Module do nos++ 
    progressStart(x, "Experiment", "Something", nos) 
    nos = 0 
    for o in current Module do {
        string h = o."Object Heading"
        progressStep ++nos
        if (null h) h = "null heading"
        progressMessage h 
        if (progressCancelled) {
            if (confirm("Exit loop?")) {
                progressStop
                halt
            }
        }
    } 
    progressStop 
}
DB progressDB = create "Progress test" 
realize progressDB 
progCB(progressDB)
hide progressDB

Use "dbExplorer", which is the global variable for the main DOORS window, in place of progressDB.

So, in the code above, eliminate the last 4 lines of code, and add:
progCB(dbExplorer)

.... should work

Re: Progress Bar progressStart() - can I show it without underlying DB?
strathglass - Wed Jul 08 08:16:17 EDT 2009

djakad - Tue Jul 07 17:02:46 EDT 2009
Use "dbExplorer", which is the global variable for the main DOORS window, in place of progressDB.

So, in the code above, eliminate the last 4 lines of code, and add:
progCB(dbExplorer)

.... should work

Exactly what I was looking for djakad, dbExplorer works perfectly, thanks!

Here is a sample that uses dbExplorer without any explicit new DB for the progress bar to run on:
 

pragma runLim,0
int nos=0
Object o
for o in current Module do nos++
progressStart(dbExplorer, "Experiment", "Something", nos) 
nos = 0 
for o in current Module do 
{
    string h=o."Object Heading"
    progressStep ++nos
    if (null h) h = "null heading"
    progressMessage h 
    //add delay so we have time to see progress bar:
    int j,k;for (j=0;j<1000;j++) k=j*2-3
    if (progressCancelled) {
        if (confirm("Exit loop?")) {
            progressStop
            halt
        }
    }
} 
progressStop

 


Regards, Strathglass

 

Re: Progress Bar progressStart() - can I show it without underlying DB?
meherts - Fri Aug 27 11:22:26 EDT 2010

strathglass - Wed Jul 08 08:16:17 EDT 2009

Exactly what I was looking for djakad, dbExplorer works perfectly, thanks!

Here is a sample that uses dbExplorer without any explicit new DB for the progress bar to run on:
 

pragma runLim,0
int nos=0
Object o
for o in current Module do nos++
progressStart(dbExplorer, "Experiment", "Something", nos) 
nos = 0 
for o in current Module do 
{
    string h=o."Object Heading"
    progressStep ++nos
    if (null h) h = "null heading"
    progressMessage h 
    //add delay so we have time to see progress bar:
    int j,k;for (j=0;j<1000;j++) k=j*2-3
    if (progressCancelled) {
        if (confirm("Exit loop?")) {
            progressStop
            halt
        }
    }
} 
progressStop

 


Regards, Strathglass

 

Thanks, Strathglass.

Regards,
meherts

Re: Progress Bar progressStart() - can I show it without underlying DB?
Martin_Hunter - Tue Mar 11 12:00:32 EDT 2014

meherts - Fri Aug 27 11:22:26 EDT 2010
Thanks, Strathglass.

Regards,
meherts

If the user has the DOORS Explorer minimised then the progress bar does not appear.

Any ideas how I can ensure the progress bar is always visible?

Martin

Re: Progress Bar progressStart() - can I show it without underlying DB?
llandale - Tue Mar 11 13:01:33 EDT 2014

Martin_Hunter - Tue Mar 11 12:00:32 EDT 2014

If the user has the DOORS Explorer minimised then the progress bar does not appear.

Any ideas how I can ensure the progress bar is always visible?

Martin

Try "bringToFront(dbExplorer)" before definging the progress bar.

Re: Progress Bar progressStart() - can I show it without underlying DB?
anotherDaniel - Wed Aug 09 14:25:24 EDT 2017

llandale - Tue Mar 11 13:01:33 EDT 2014

Try "bringToFront(dbExplorer)" before definging the progress bar.

I needed to do this, so was very happy for this thread. I'll add some more for the next person who consults it. llandale's suggestion didn't work because bringToFront works on modules but dbExplorer is a dialog box. I got this to work: setPos(dbExplorer, 70,10).